package com.zyw.jta;

import javax.activation.DataSource;
import javax.transaction.*;
import java.util.Map;

/**
 * @author zhangyw
 * @version 17/3/9 22:26
 */
public class TransactionManagerImpl implements TransactionManager {

    private ThreadLocal<Map<String, DataSource>> dsHolder = new ThreadLocal<Map<String, DataSource>>();

    public void setDataSources(Map<String, DataSource> dataSources) {
        dsHolder.set(dataSources);
    }


    public void begin() throws NotSupportedException, SystemException {

    }

    public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException, RollbackException, SecurityException, SystemException {

    }

    public int getStatus() throws SystemException {
        return 0;
    }

    public Transaction getTransaction() throws SystemException {
        return null;
    }

    public void resume(Transaction transaction) throws IllegalStateException, InvalidTransactionException, SystemException {

    }

    public void rollback() throws IllegalStateException, SecurityException, SystemException {

    }

    public void setRollbackOnly() throws IllegalStateException, SystemException {

    }

    public void setTransactionTimeout(int i) throws SystemException {

    }

    public Transaction suspend() throws SystemException {
        return null;
    }
}
